from node import *
class treenode():
    def __init__(self):
        self.node=node(10)

tree=treenode()
tree.node.data=10

tree.node.left=node(20)
tree.node.right=node(30)
tree.node.left.left =node(40)
tree.node.left.right=node(50)
tree.node.right.left=node(60)
tree.node.right.right=node(70)
tree.node.left.left.left=node(80)
tree.node.left.left.right=node(90)
tree.node.left.right.left=node(100)
tree.node.left.right.right=node(110)
tree.node.right.left.left=node(120)
tree.node.right.left.right=node(130)
tree.node.right.right.left=node(140)
tree.node.right.right.right=node(150)
li=[]

def f(node):
    if not node:
        return
    li.append(node.data)
    f(node.left)
    f(node.right)
f(tree.node)
print(li)

limid=[]
def g(node):
    if not node:
        return
    g(node.left)
    limid.append(node.data)
    g(node.right)
g(tree.node)
print(limid)


li1=[]
def h(node):
    if not node:
        return
    h(node.left)
    h(node.right)
    li1.append(node.data)

h(tree.node)
print(li1)